<?php
/**
 *
 *
 * @author Zeon <scplay@gmail.com>
 * @date 2019/5/28 14:36
 * @copyright PanxSoft Inc.
 */

namespace App\Http\Controllers\App\V1;


use App\Http\Controllers\ApiController;
use App\Models\Device;

class DeviceController extends ApiController
{
    const ROUTES = [
        'index' => 'app.v1.userDevice.index',
    ];

    /**
     * 厂家设备列表
     *
     * @return array|\Illuminate\Http\Response
     */
    public function index()
    {
        $devices = (new Device)
            ->oldest('sort_order')
            ->latest('created_at')
            ->where('is_show', Device::IS_SHOW)
            ->with('localeDescription')
            ->get()
        ;

        return $this->response(compact('devices'));
    }

}